//
//  ViewController.m
//  TestStoryBoard
//
//  Created by gzjd on 2017/11/16.
//  Copyright © 2017年 gzjd. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
#import "Masonry.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=UIColor.cyanColor;
    // 初始化view并设置背景
    UIView *view = [UIView new];
    view.backgroundColor = [UIColor redColor];
    [self.view addSubview:view];
    
    // 使用mas_makeConstraints添加约束
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        
        // 添加大小约束（make就是要添加约束的控件view）
        make.size.mas_equalTo(CGSizeMake(100, 100));
        // 添加居中约束（居中方式与self相同）
        make.center.equalTo(self.view);
    }];
    // Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)jumpToNextPage:(id)sender {
    NSLog(@"点了");
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//这就是点击跳转时执行的方法
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    NSLog(@"跳转");
    SecondViewController *second=segue.destinationViewController;
    NSString *str=self.textFiled.text;
    //NSString =@"传给你一个值%@"str;
    second.str=[@"传值:" stringByAppendingString:str];//;//[NSString get]   ///stringByAppendingFormat:@"%@",@"传给你一个值"];
}
@end
